package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementSrSrtpWorkoamMapper;
import com.ruoyi.net.domain.ElementSrSrtpWorkoam;
import com.ruoyi.net.service.IElementSrSrtpWorkoamService;

/**
 * 网元-SR-srtp-工作oamService业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementSrSrtpWorkoamServiceImpl implements IElementSrSrtpWorkoamService 
{
    @Autowired
    private ElementSrSrtpWorkoamMapper elementSrSrtpWorkoamMapper;

    /**
     * 查询网元-SR-srtp-工作oam
     * 
     * @param id 网元-SR-srtp-工作oam主键
     * @return 网元-SR-srtp-工作oam
     */
    @Override
    public ElementSrSrtpWorkoam selectElementSrSrtpWorkoamById(String id)
    {
        return elementSrSrtpWorkoamMapper.selectElementSrSrtpWorkoamById(id);
    }

    /**
     * 查询网元-SR-srtp-工作oam列表
     * 
     * @param elementSrSrtpWorkoam 网元-SR-srtp-工作oam
     * @return 网元-SR-srtp-工作oam
     */
    @Override
    public List<ElementSrSrtpWorkoam> selectElementSrSrtpWorkoamList(ElementSrSrtpWorkoam elementSrSrtpWorkoam)
    {
        return elementSrSrtpWorkoamMapper.selectElementSrSrtpWorkoamList(elementSrSrtpWorkoam);
    }

    /**
     * 新增网元-SR-srtp-工作oam
     * 
     * @param elementSrSrtpWorkoam 网元-SR-srtp-工作oam
     * @return 结果
     */
    @Override
    public int insertElementSrSrtpWorkoam(ElementSrSrtpWorkoam elementSrSrtpWorkoam)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementSrSrtpWorkoam.getId())) {
            elementSrSrtpWorkoam.setId(uuid);
        }
        elementSrSrtpWorkoam.setCreateBy(SecurityUtils.getUsername());
        elementSrSrtpWorkoam.setCreateTime(DateUtils.getNowDate());
        elementSrSrtpWorkoam.setUpdateBy(SecurityUtils.getUsername());
        elementSrSrtpWorkoam.setUpdateTime(DateUtils.getNowDate());
        return elementSrSrtpWorkoamMapper.insertElementSrSrtpWorkoam(elementSrSrtpWorkoam);
    }

    /**
     * 修改网元-SR-srtp-工作oam
     * 
     * @param elementSrSrtpWorkoam 网元-SR-srtp-工作oam
     * @return 结果
     */
    @Override
    public int updateElementSrSrtpWorkoam(ElementSrSrtpWorkoam elementSrSrtpWorkoam)
    {
        elementSrSrtpWorkoam.setUpdateBy(SecurityUtils.getUsername());
        elementSrSrtpWorkoam.setUpdateTime(DateUtils.getNowDate());
        return elementSrSrtpWorkoamMapper.updateElementSrSrtpWorkoam(elementSrSrtpWorkoam);
    }

    /**
     * 批量删除网元-SR-srtp-工作oam
     * 
     * @param ids 需要删除的网元-SR-srtp-工作oam主键
     * @return 结果
     */
    @Override
    public int deleteElementSrSrtpWorkoamByIds(String[] ids)
    {
        return elementSrSrtpWorkoamMapper.deleteElementSrSrtpWorkoamByIds(ids);
    }

    /**
     * 删除网元-SR-srtp-工作oam信息
     * 
     * @param id 网元-SR-srtp-工作oam主键
     * @return 结果
     */
    @Override
    public int deleteElementSrSrtpWorkoamById(String id)
    {
        return elementSrSrtpWorkoamMapper.deleteElementSrSrtpWorkoamById(id);
    }
}
